<%--
  Created by IntelliJ IDEA.
  User: hyatt
  Date: 2022/1/21
  Time: 14:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page isELIgnored="false" %>
<!-- 引入jstl标签库 -->
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!-- 计算对象的长度 -->
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<html>
<head>
    <title>Jstl使用-if标签</title>
</head>
<body>
<c:if test="${status==1}">
    启用
</c:if>
<c:if test="${status!=1}">
    禁用
</c:if>
长度：${fn:length(brands)}
<table>
    <c:forEach items="${brands}" var="brand" varStatus="status">
        <tr align="center">
            <td>${brand.id}</td>
            <td>${brand.brandName}</td>
            <td>${brand.companyName}</td>
            <td>${brand.description}</td>
        </tr>
    </c:forEach>
</table>
<br>

<table>
    <c:forEach begin="0" end="${fn:length(brands)}" step="1" var="i">
        <tr align="center">
            <td>${brands[i].id}</td>
            <td>${brands[i].brandName}</td>
            <td>${brands[i].companyName}</td>
            <td>${brands[i].description}</td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
